package cs

import "context"

const (
	CsProviderAliyun  = "aliyun"
	CsProviderBaidu   = "baidu"
	CsProviderHuawei  = "huawei"
	CsProviderTencent = "tencent"
)

var Cs = cs{}

type cs struct {
	ctx      context.Context
	provider string
}

func (r cs) Ctx(ctx context.Context) cs {
	r.ctx = ctx

	return r
}
func (r cs) Provider(provider string) cs {
	r.provider = provider

	return r
}

func (r cs) New() csBase {
	switch r.provider {
	case CsProviderBaidu:
		return CsBaidu
	case CsProviderHuawei:
		return CsHuawei
	case CsProviderTencent:
		return CsTencent
	case CsProviderAliyun:
		fallthrough
	default:
		return CsAliyun
	}
}
